#!/bin/sh

for i in $PLIBDIRS # $PLIBDIRS is exported in 2createpackages
do
	[ -d $i ] || continue
	LIBIWFILE=`ls -1 ${i}/libiw.so.[0-9]* | head -n 1`
	if [ -e "$LIBIWFILE" ] ; then
		LIBIWFILE=${LIBIWFILE##*/}
		LIBIWVER=${LIBIWFILE##*.}
		ln -sv $LIBIWFILE ${i}/libiw.so.$(($LIBIWVER - 1))
		ln -sv $LIBIWFILE ${i}/libiw.so.$(($LIBIWVER - 2))
		ln -sv $LIBIWFILE ${i}/libiw.so.$(($LIBIWVER - 3))
		ln -sv $LIBIWFILE ${i}/libiw.so.$(($LIBIWVER - 4))
		ln -sv $LIBIWFILE ${i}/libiw.so.$(($LIBIWVER - 5))
	fi
done
